#ifndef _RICH_TEXT_WIDGET_H_
#define _RICH_TEXT_WIDGET_H_

#include <QWidget>
#include "ui_richtext.h"

class QNewTreeWidget;

class QRichTextWidget :	public QWidget
{
	Q_OBJECT

public:
	explicit QRichTextWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
	virtual ~QRichTextWidget(void);

	static QRichTextWidget& GetInstance(void);

	bool showText(QNewTreeWidget* pEditor, const QString& rText);

	void closeEvent(QCloseEvent* event); 

public slots:
	void OnSelectColor(void);
	void OnSelectLink(const QString& text);
	void OnInsertLink(void);
	void OnActionColor(bool checked);
	void OnActionTag(bool checked);
	void OnActionLink(bool checked);

private:
	static QRichTextWidget* ms_pInstance;
	Ui::richTextWidget		ui;
	QNewTreeWidget*			m_pEditor;
};

#endif	// _RICH_TEXT_WIDGET_H_